<?php 
defined('BASEPATH') OR exit('No direct script access allowed');
class Tags extends Ctcms_Controller{
	function __construct(){

	    parent::__construct();

	}
	public function index()

	{
		
		
				 $sql = 'select id,xid,name from '.CT_SqlPrefix.'class where 1=1  ';
				 $result["types"]=$this->parser->CI->db->query($sql)->result_array();
	

				//$key=
				$types=['Web_Diqu','Web_Yuyan','Web_Year','Web_Type'];
				for($i=0;$i<count($types);$i++){
					if($i==0)
					$arr = explode('|',Web_Diqu);
				    if($i==1)
				    $arr = explode('|',Web_Yuyan);	
				    if($i==2)
				    $arr = explode('|',Web_Year);	
				    if($i==3){
				    	$type=preg_replace('/[0-9]/', "", Web_Type);
				    	$type=preg_replace('/\r\n/',"",$type);
				    	$arrT = explode('#',$type);
				    	array_splice($arrT, 0, 1); //删除第一个数组
				        	$arr=$arrT;
				    	    for($j=0;$j<count($arrT);$j++){
				    	 		$arr[$j]=explode("|",$arrT[$j]);
				    	 	}
				    	}
				    $result[$types[$i]]=$arr;	
				}
		
              	echo json_encode($result);
    }
}